import {createStore} from 'vuex'
import user from './modules/user'

const store = createStore({
    modules:{
        user
    },
    state: {
        routeLoaded: false, // 菜单路由加载
        firstRoute: null, // 第一个路由 主页redirect
        menuTree: null 
    },
    mutations: {
        setRouteLoaded(state, loaded) {
            state.routeLoaded = loaded
        },
        setFirstRoute(state, route) {
            state.firstRoute = route
        },
        setMenuTree(state, data) {
            state.menuTree = data
        }
    }
})

export default store